package fule.com.playandroidkotlin.ui.adapter

import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import fule.com.playandroidkotlin.R
import fule.com.playandroidkotlin.ui.model.ChildrenBean

/**
 * 作者： njb
 * 时间： 2018/8/13 0013-下午 2:26
 * 描述： 文章标题
 * 来源：
 */
class ArticleTabAdapter(data: List<ChildrenBean>?) : BaseQuickAdapter<ChildrenBean, BaseViewHolder>(R.layout.item_tab, data) {
    override fun convert(helper: BaseViewHolder?, item: ChildrenBean?) {
        helper ?: return
        item ?: return

        helper.setText(R.id.tab_name,item.name)
        if (item.isSelect) {
            helper.setTextColor(R.id.tab_name, ContextCompat.getColor(mContext,R.color.colorPrimary))
        } else {
            helper.setTextColor(R.id.tab_name, ContextCompat.getColor(mContext,R.color.c999999))
        }
    }

}